package com.gin.no_gay_alliance.database.dao;

import androidx.room.Dao;
import androidx.room.Delete;
import androidx.room.Insert;
import androidx.room.OnConflictStrategy;
import androidx.room.Query;
import androidx.room.Update;

import com.gin.no_gay_alliance.database.entity.ScanTask;

import java.util.List;

/**
 * @author : ginstone
 * @version : v1.0.0
 * @since : 2023/9/20 16:16
 **/
@Dao
public interface ScanTaskDao {
    @Insert(onConflict = OnConflictStrategy.REPLACE)
    void add(ScanTask scanTask);

    @Delete
    int delete(ScanTask scanTask);

    @Query("select * from ScanTask where id=:id")
    ScanTask get(int id);

    @Query("SELECT * FROM ScanTask")
    List<ScanTask> listAll();

    @Update
    int update(ScanTask scanTask);


}
